import {Request, Response} from "express";
import dictSql from "@src/sql/dictSql";
import httpStatusCodes from "@src/declarations/major/HttpStatusCodes";
import Constant from "@src/util/constant";

const paths = {
  dictLiteratureList: '/dict-literature-list',
  dictArticleList: '/dict-article-list',
  dictRegionList: "/dict-region-list",
};

// 文献字典
const dictLiteratureList = async (req: Request, res: Response) => {
  const data = await dictSql.category("16451247502528512");
  return res.status(httpStatusCodes.OK).json({
    data: {
      ...Constant.DEFAULT_SUCCESS,
      data,
    },
  });
};

// 文章字典
const dictArticleList = async (req: Request, res: Response) => {
  const data = await dictSql.category("16451192812998656");
  return res.status(httpStatusCodes.OK).json({
    data: {
      ...Constant.DEFAULT_SUCCESS,
      data,
    },
  });
};

//区域字典
const dictRegionList = async (req: Request, res: Response) => {
  const data = await dictSql.category("16451192817192960");
  return res.status(httpStatusCodes.OK).json({
    data: {
      ...Constant.DEFAULT_SUCCESS,
      data,
    },
  });
};


export default {
  paths,
  dictLiteratureList,
  dictArticleList,
  dictRegionList,
};